UNIT Acerta;

Interface

Uses
EXTDR,ADC,Crt,Dos,Graph,GlobVar,calnvc,show,escreva;

Procedure CalcArea;
Procedure Smooth;

Implementation


Procedure CalcArea;

const g=0.00;
    cal = 0.20;
    calv = 1.43;
var xxx  :  real;
   acum   : real;
   ref    : real;
   kk     :  integer;
   v1,v2,v3  : integer;

begin
 v1:=xo;
 v2:=v;
 ref:=(cal*EscX[IEscX]/5)*(v-v1)*
 0.03333*(EscY[IescY]*(abs(buffer[u+EscX[IEscX]*v1 div 2]))/calY[IescY]);
 acum:=0;
 for kk:=V1 to v2 do begin
 acum:=acum+
 0.03333*EscY[IescY]*(abs(buffer[u+EscX[IEscX]*kk div 2]-
 buffer[u+EscX[IEscX]*v1 div 2]))/calY[IescY];
 line(m*kk,a+ptInicial+10*(buffer[u+EscX[IescX]*v1 div 2]) div calY[IescY],
 m*kk,a+Ptinicial+10*((buffer[u+EscX[IEscX]*kk div 2])) div calY[IescY]);
 end;

          case IEscY of
     0..3     :  begin
                 acum:=acum/1000;
                 end;
     4..12    :  begin
                  acum:=acum/1000;
                 end;
    13..15    :  begin
                 end;
        end;

 nervou.memI[Imem,4]:=(EscX[IEscX])*acum/1.5;
 setfillstyle(9,9);
  If nervou.memI[Imem,4]<1 then WriteText(PosX+198+hx,pos2Y+PosY2janCont+hh+(Imem)*h,real1str(nervou.memI[Imem,4]))
 else WriteText(PosX+198+hx,pos2Y+PosY2janCont+hh+(Imem)*h,real0str(nervou.memI[Imem,4]));
 setfillstyle(0,1);
end;

Procedure Smooth;

var   ii   :   integer;

begin
     Mostra;
     If escY[IescY]>10 then begin
     for ii:=1 to 8000 do
       begin
         buffer[2*ii]:=(buffer[2*(ii-1)]+buffer[2*ii]+buffer[2*(ii+1)]) div 3;
         buffer[2*ii+1]:=(buffer[2*ii]+buffer[2*(ii+1)]) div 2;
       end;
     Mostra;
     {end else begin}
     {for ii:=1 to 7999 do
     buffer[2*ii]:=(buffer[2*ii-1]+buffer[2*ii]+buffer[2*ii+1]) div 3;
     Mostra;}
   end;

end;

end.